import axios from '@/utils/request';


/**
 * 获取业务员提成付款明细查询分页列表
 */
 export async function QueryPaysalecommissionitemPageList(params) {
    const res = await axios.post('/Paysalecommissionitem/QueryPaysalecommissionitemPageList',params);
    if (res.data.code === 200) {
        return res.data.data;
    }
    return Promise.reject(new Error(res.data.msg));
}

/**
 * 根据id获取业务员提成付款明细
 */
 export async function GetPaysalecommissionitemById(id) {
    const res = await axios.get('/Paysalecommissionitem/GetModelById/'+id);
    if (res.data.code === 200) {
        return res.data.data;
    }
    return Promise.reject(new Error(res.data.msg));
}


/**
 * 新增预收款明细
 */
export async function AddPaysalecommissionitem(params) {
    const res = await axios.post('/Paysalecommissionitem/AddPaysalecommissionitem',params);
    if (res.data.code === 200) {
        return res.data.msg;
    }
    return Promise.reject(new Error(res.data.msg));
}

/**
 * 删除预收款明细
 */
 export async function DeletePaysalecommissionitem(id) {
    const res = await axios.post('/Paysalecommissionitem/DeletePaysalecommissionitem?id='+id);
    if (res.data.code === 200) {
        return res.data.msg;
    }
    return Promise.reject(new Error(res.data.msg));
}